<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <script type="text/javascript" src="js/jquery-1.10.1.min.js"></script>
  <script src="js/md5.js"></script>
  <script src="js/layer.js"></script>
  <script src="js/public.js"></script>
  <link type="text/css" rel="stylesheet" href="css/layout.css">
	<link rel="stylesheet" type="text/css" href="css/common.css">
  <title>header</title>
  <style>
    .demo-class .layui-layer-content{
      color:#333
    }
  </style>
</head>
<body>
    
  <script type="text/javascript">
  $(function(){

		var type = parent.$('.content').data('li');
		switch(type){
			case 'lhc':
				$("#li_GameBYW").addClass("c");
			break;
			case 'yfsc':
				$("#li_lottery").addClass("c");
			break;
			case 'bfyfc':
				$("#li_lottoffc").addClass("c");
			break;
			case 'bflhc':
				$("#li_lotto").addClass("c");
			break;
			case 'bjsc':
				$("#li_slots").addClass("c");
			break;
			case 'cqssc':
				$("#shishicai").addClass("c");
			break;
			default:
				$("#li_home").addClass("c");
		}
	})
  </script>

  <div class="headers">
    <div class="header">
      <div class="header_top w">
        <div class="logo"></div>
        <div class="logo_right"></div>
        <div class="login">
          <div class="login_top">
            <ul>
              <li>
                <a href="javascript:;" target="_blank">
                  <span class="box22">APP下载</span>
                </a>
              </li>
              <li>|</li>
              <li>
                <a onclick="AddFavorite(window.location,document.title)" href="javascript:void(0)">
                  <span class="box22">加入收藏</span>
                </a>
              </li>
              <li>|</li>
              <li>
                <a onclick="SetHome(window.location)" href="javascript:void(0)">
                  <span class="box22">设为首页</span>
                </a>
              </li>
              <li>|</li>

              <li>
                <a href="javascript:;" target="_blank">
                  <span class="box22">手机版</span>
                </a>
              </li>
              <li>
                <a href="#" class="goToMobile"></a>
              </li>
            </ul>
          </div>
          <div class="login_bottom" id="login_before">
              <div class="open_account"><a href="./register.html" target="self"></a></div>
              <div class="text_right">
                <div class="text_right_top h">
                  <ul>
                    <li>
                      <input type="text" class="username" placeholder="用户名"  id="loginUsername" maxlength="16">
                    </li>
                  </ul>
                </div>
                <div class="text_right_bottom h">
                  <ul>
                    <li>
                      <input type="password" class="password" placeholder="密码" id="loginPassword" maxlength="20" >
                    </li>
                    <li><a class="btn_log">登录</a></li>
                    <li><a class="pasd">忘记密码？</a></li>
                  </ul>
                </div>
              </div>
          </div>
          <div class="login_bottom" id="login_after">
            <div class="login_enter">
              <div class="login_enter_top login_enter_p">
                <dl>
                  <dd>
                    <p><a style="background: url(images/ai.png) top left no-repeat;" href="javascript:;" id="username"></a></p>
                    <p class="logoutSubmit"><a style="color: #f9e284;" >退出</a></p>
                  </dd>
                  <dd class="login_enter_right">
                    <span>
                      <a id="all_balance" class="balance MAIN_WALLET" ></a>
                      <a class="refresh_login" ></a>
                    </span>
                  </dd>
                </dl>
              </div>
              <div class="login_enter_bottom login_enter_p">
                <ol>
                  <li><a href="./standings.html" target="self">会员中心</a></li>
                  <li>|</li>
                  <li><a  href="./recharge.html" target="self">充值</a></li>
                  <li>|</li>
                  <li ><a href="./withdraw.html" target="self">提现</a></li>
                  <li>|</li>
                  <li><a >额度转换</a></li>
                  <li>|</li>
                  <li><a >信息(<span id="unreadMsg">0</span>)</a> </li>
                </ol>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="clear"></div>
    <div class="menu" id="menu">
      <div id="menu_nav" class="menu_nav w">
        <ul>
          <li>
            <a id="li_home" class="dis" href="./index.html" target="self">网站首页</a>
          </li>
          <li class="long"></li>
          <li>
            <a id="li_lottery" class="dis" href="yfsc.html" target="self">一分赛车</a>
          </li>
          <li class="long"></li>
          <li >
            <a id="li_lottoffc" class="dis" href="bfyfc.html" target="self">一分彩</a>
          </li>
          <li class="long"></li>
          <li >
            <a id="li_lotto" class="dis" href="bflhc.html" target="self">必发六合彩</a>
          </li>
          <li class="long"></li>
          <li >
            <a id="li_slots" class="dis" href="bjsc.html" target="self">北京赛车</a>
          </li>
          <li class="long"></li>
          <li>
            <a id="li_GameBYW" class="dis" href="lhc.html" target="self">六合彩</a>
          </li>
          <li class="long"></li>
          <li>
            <a id="shishicai" class="dis" href="cqssc.html" target="self">重庆时时彩</a>
          </li>
          <li class="long"></li>
          <li>
            <a id="li_sports" class="dis" href="javascript:;" target="self">推荐</a>
          </li>
          <li class="long"></li>
          <li>
            <a id="li_GameQP" class="dis" href="javascript:;" target="self">活动</a>
          </li>
          <li class="long"></li>
          <li>
            <a id="li_promotion" class="dis box11" href="javascript:;" target="self">优惠活动</a>
          </li>
          <li>
            <a  class="server" target="_blank">在线客服</a>
          </li>
        </ul>
      </div>
    </div>
  </div>
    <script type="text/javascript">
      //加入收藏
      function AddFavorite(sURL, sTitle) {
        sURL = encodeURI(sURL);
        try {
          window.external.addFavorite(sURL, sTitle);
        } catch (e) {
          try {
            window.sidebar.addPanel(sTitle, sURL, "");
          } catch (e) {
            alert("抱歉，您所使用的浏览器无法完成此操作。\n\n加入收藏失败，请使用Ctrl+D进行添加！");
          }
        }
      }
  
      //设为首页
      function SetHome(url) {
        if (document.all) {
          document.body.style.behavior = 'url(#default#homepage)';
          document.body.setHomePage(url);
        } else {
          alert("您好,您的浏览器不支持自动设置页面为首页功能,请您手动在浏览器里设置该页面为首页!");
  
        }
      }
  
    </script>

    <script>
      $(function(){
			
        var uid = getCookie('uid');
  
        function regis(){

          if( uid ){
						
						$('#login_before').hide();
						$('#login_after').show();					
						
            // 退出登录
            $('.logoutSubmit').click(function(){
              
              layer.confirm('确定退出当前账户?', {
                  btn: ['确定','取消'], //按钮
                  skin: 'demo-class'
                }, function(){
                  layer.msg('成功退出',{time:1000},function(){
                    clearCookie('uid');
                    window.location.reload();
                  });
                });
              
            })
            
            $ajax(
              url + 'member_info',
              'post',
              {timeStamp:timeStamp,token:token,test:test,uid:uid},
              function (data){
                
                $('#username').text(data.data.username);
                $('#all_balance').text(data.data.balance);
                $('#unreadMsg').text(data.data.msgtag);
                $('.refresh_login').click(function(){
                  $('#all_balance').text(data.data.balance);
                  $(this).css('transform','rotate(360deg)');
                })
                $('#menu_nav .server').on('click',function(){
                  
                  openQQ(data.data.serviceQQ)
                })
              },
              function(data){
                clearCookie('uid');
                
                layer.msg(data.msg,{time:2000});
              }
            )

          }else{

            $('#login_before').show();
            $('#login_after').hide();
            
          }
        } 
        
        regis();

        $('.btn_log').on('click',function(){
          
          var username = $('#loginUsername').val();
          var password = hex_md5($('#loginPassword').val());
          var obj = jsonObj;
          obj.username = username;
          obj.password = password;
          
          $ajax(
            url + 'login',
            'post',
            obj,
            function (data){
              
              setCookie('uid',data.data.uid,1);
              
              layer.msg('登陆成功',{time:1000},function(){
                window.location.reload()
              });
              
            },
            function(data){
              
              layer.msg(data.msg,{time:2000});
            }
          )
        })
        
      })
      
    </script>
</body>
</html>